find triplets for given sum in array